from building import *

cwd  = GetCurrentDir()
src  = Glob('*.cpp')
src  += Glob('ApuEX/emu2413/*.c')
src  += Glob('ApuEX/*.cpp')
src  += ['Mapper/MapperFactory.cpp']
src  += ['Mapper/Mapper.cpp']

list = os.listdir(cwd)
CPPPATH = [cwd] 
CPPPATH += [cwd + '/ApuEX']
CPPPATH += [cwd + '/Mapper']
CPPPATH += [cwd + '/PadEX']
CPPPATH += [cwd + '/ApuEX/emu2413']

objs = []
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)

for d in list:
    path = os.path.join(cwd, d)
    if os.path.isfile(os.path.join(path, 'SConscript')):
        objs = objs + SConscript(os.path.join(d, 'SConscript'))
objs = objs + group
Return('objs')
